#include <iostream>

/*
class  Recver{
public:
    static Recver * create(){return new Recver();}
};


class Command {
public:
    static Command * createConcrete(Recver * recv);

    virtual ~Command(){}
    virtual void execute(){}
};

class ConcreteCommand : public Command {
public:
    ConcreteCommand(Recver * recv){}
    virtual ~ConcreteCommand(){}
    void execute(){
        std::cout << "ConcreteCommand execute" << std::endl;
    }
};
Command * Command::createConcrete(Recver * recv){
    return new ConcreteCommand(recv);
}

#include <list>
class Invoker {
    std::list<Command *> commands_;
public:
    static Invoker * create(){
        return new Invoker();
    }
    ~Invoker(){
        commands_.clear();
    }

    void add(Command * c){
        if(c != NULL){
            commands_.push_back(c);
        }
    }
    void run(){
        std::list<Command *>::iterator iter = commands_.begin();
        while(iter != commands_.end()){
            (*iter)->execute();
            ++iter;
        }
    }

private:
    Invoker(){}
};



int main(int argc, char * argv[]){
    std::cout << "Hello world" << std::endl;

    Invoker * inv = Invoker::create();
    Recver * recv =  Recver::create();
    Command * c = Command::createConcrete(recv);
    inv->add(c);

    inv->run();

    delete c;
    delete recv;
    delete inv;


    return 0;
}*/

#include "TestHashInvoker.h"

int main(int argc, char * argv[]){
    TestHashInvoker();
    return 0;
}
